home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
ca29_4.zip
/
CACMP.DOC
next >
Wrap
Text File
|
1992-11-30
|
21KB
|
880 lines
COM-AND Script Utility
---------------------------------------
COM-AND Script Utility
Script utility for the COM-AND language
---------------------------------------
CACMP ver.1.2 and COM-AND are copyright by 1992 CABER Software.
CACMP and COM-AND are distributed freely and may be copied by
anyone for any number of machines, for purposes of evaluation.
The author offers COM-AND and its accessory programs together
as "shareware". If you USE the program you MUST pay for it.
The complete user license and registration information is to be
found in the file REGISTER.DOC. Limitations on redistribution
of COM-AND are set out in the file VENDOR.DOC. These two files
are included with the COM-AND program release.
CABER Software
R. (Scott) McGinnis
P.O. Box 3607 Mdse Mart
Chicago, IL 60654-0607
GEnie, Delphi: TARTAN
CIS .......... 73147,2665
Internet ..... 73147.2665@compuserve.com
Version 1.2: 921012
COM-AND Script Utility
Table of Contents
-----------------
I. Introduction .............................................. page 1
II. Running CACMP ............................................. page 2
III. CACMP functions ............................................ page 4
A. Syntax check ............................................ page 4
B. Semantic check .......................................... page 5
C. Partial strip ........................................... page 9
D. Full strip .............................................. page 10
E. Preprocessing ........................................... page 11
IV. CACMP and COM-AND .......................................... page 12
V. Program Requirements ....................................... page 13
VI. Program and Author Information ............................ page 14
Version 1.2: 921012
COM-AND Script Utility Page 1
I. Introduction
A. What is COM-AND?
COM-AND for the IBM PC and compatibles is a communications pro-
gram for use by itself, or with several integrated accessory
programs (which themselves may be used independently of COM-AND).
COM-AND provides standard comm program functions: a dialing
directory, macros, disk logging, binary and ASCII file transfers,
... and scripted execution.
B. COM-AND scripts
A script automates certain manual tasks, and allows COM-AND to
run unattended (if the script has been tested (!!!)). A script
is a program written to control COM-AND execution. Scripts
distributed with COM-AND include: LEARN mode (a script that
writes a script), a FILEMGR (perform DOS functions and find
files for transmission), a BBS, a HOST mode, and many more.
Script commands are read by COM-AND from an ASCII file (word
processor files are not usually ASCII files (!)). COM-AND's
internal editor (Alt-Q), programmer's text editors and EDLIN
(included with DOS) may be used to create and modify a script
file.
C. The CACMP program
CACMP is a diagnostic and preprocessor for COM-AND scripts.
CACMP may be used simply to perform syntax and semantic review
of a COM-AND script, or it may be used to preprocess scripts
for COM-AND.
This document discusses the use of CACMP.EXE. COM-AND scripts
and the script language are discussed in the CASCRIPT.DOC
document, distributed with COM-AND.
Version 1.2: 921012
COM-AND Script Utility Page 2
II. Running CACMP
Generally, CACMP is invoked at the DOS prompt with the command:
-----------------------------------------------------------------
"d>" CACMP <options> [<infilename> [<outfilename>]]
Where "d>" is the DOS prompt, and
<options> are [<switch> [<switch> ...]]
-----------------------------------------------------------------
CACMP could be invoked with a command such as:
"d>" CACMP
to simply start CACMP. In this case, CACMP prompts for an input
file and does not write a stripped/preprocessed file. The command:
"d>" CACMP /s
causes CACMP to prompt for both an input AND an output file name
(the input file MUST NOT be the same as the output file). Output
is the input stripped of comments (see below).
CACMP by default deletes an output file (if there is one) when a
syntax error is found. This action may be inhibited with the switch
"/k". In the case:
"d>" CACMP /s/k
the output file is retained (and lines marked as 'syntax errors'
are retained (partially stripped, regardless of preprocessing).
The input file name (and output file name) may be specified in the
run command. For example:
"d>" CACMP /s bbs.src
reads the file BBS.SRC and prompts for an output file name. Input
file names default to the extension ".CMD" if the name given is not
found. The output file, if it exists, is deleted and recreated when
CACMP begins. For this reason, CACMP must not be run with the same
file as INPUT and output.
Version 1.2: 921012
COM-AND Script Utility Page 3
II. Running CACMP (continued)
The following switches are defined for CACMP at run-time:
/1 Partial strip output (see below)
/s Full strip output (see below)
/k Keep output when syntax error is detected
/p Preprocess script (for speed)
The default settings for CACMP are: no output, and delete output if
a syntax error is detected.
All error and diagnostic output by CACMP is directed to the standard
output device. Therefore, the command:
"d>" CACMP >temp script.cmd
records all the diagnostic information in the file TEMP on the cur-
rent subdirectory, for later review.
When CACMP terminates it displays the following summary:
Total input lines:
Total input statements:
Total input comments:
Total input labels:
Total syntax errors:
Total semantic warnings:
If CACMP created an output file, CACMP also reports:
Input file size:
Output file size:
CACMP terminates with a DOS error level of 0 if no syntax errors and
no semantic errors are detected. CACMP terminates with a DOS error
level of 1 if either syntax or semantic errors are reported. [Batch
checks of a group of scripts may be stopped on an error using the
error level returned to DOS.]
Version 1.2: 921012
COM-AND Script Utility Page 4
III. CACMP functions
A. Syntax check
CACMP's first function is to syntactically verify each line of
the input file. Syntax errors are noted as follows:
Line 3: Syntax error
S0 = N0+5(N1+ N2)
^
General parse failure (syntax)
The first line records the line number and the error. The second
line echoes the input line. The third line points to the highest
point the parser reached parsing the line (probably close to the
point at which the error occurs). The fourth line adds any addi-
tional information returned by the parser.
Developer's note: In the fourth line, ANY return except the one
above should be reported to the author. The fourth line properly
may be considered diagnostic to CACMP. For example, 'Stack
overflow' at this point indicates that the parser recursed beyond
its stack - a CACMP problem and not an input problem.
All error and diagnostic information listed by CACMP is directed
to the standard output device. Therefore, the command:
"d>" CACMP >temp script.cmd
records all CACMP diagnostic information in the file TEMP on the
current subdirectory, for later review.
Syntax errors are counted, and the number reported at CACMP ter-
mination. If CACMP is used to strip/preprocess a file and syntax
errors are detected, the output file is deleted (unless /k in
the run command is specified).
Ve